﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddBook.aspx.cs" Inherits="AddBook" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv ="Content-Type" content =" text/html;charset = utf-8"/>
    <title></title>
    <style type="text/css">
        .auto-style1 {
            text-align: left;
        }
        .auto-style2 {
            text-align: justify;
        }
        .auto-style3 {
            width: 37%;
            height: 399px;          
            font-size: x-large;
        }
        .auto-style4 {
            font-size: xx-large;
        }
        .logo {

        }
        .auto-style5 {
            height: 71px;
            background-repeat:no-repeat;
        }
        .auto-style6 {
            font-size: medium;
            width: 183px;
        }
    </style>
</head>
<body style="background-color: #FFFFFF; background: url('Images/background.jpg');">
    <form id="form1" runat="server">
    <div class="auto-style1">
        <center>
         <div class="auto-style2"><center>
             <h2 style="font-size: xx-small">&nbsp;</h2>
             <h2 class="auto-style4">添加新书</h2>
             <br />
             <table class="auto-style3" style="background-image: url('Images/bg.jpg')">
                 <tr>
                     <td id="logo" colspan="2" style="background-image: url('Images/logo1.jpg')" style="text-align: left" class="auto-style5"></td>
                 </tr>
                 <tr>
                     <td class="auto-style6" style="text-align: center">图 书 编 号： </td>
                     <td> <asp:TextBox ID="txtBookId" runat="server" OnTextChanged="txtBookId_TextChanged" Height="32px" Width="219px"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="auto-style6" style="text-align: center">图 书 名 称：</td>
                     <td> <asp:TextBox ID="txtBookName" runat="server" Height="33px" Width="219px"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="auto-style6" style="text-align: center">书籍分类号：</td>
                     <td>
                         <asp:TextBox ID="txtBookClassNu" runat="server" Height="33px" Width="219px"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="auto-style6" style="text-align: center">作者：</td>
                     <td><asp:TextBox ID="txtBookAuthor" runat="server" Height="33px" Width="220px"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="auto-style6" style="text-align: center">出版社：</td>
                     <td> <asp:TextBox ID="txtBookPress" runat="server" Height="33px" Width="219px"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="auto-style6" style="text-align: center">价格：</td>
                     <td> <asp:TextBox ID="txtBookPrice" runat="server" Height="33px" Width="219px"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="auto-style6" style="text-align: center">总量：</td>
                     <td> <asp:TextBox ID="txtBookNu" runat="server" Height="32px" Width="219px"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="auto-style6" style="text-align: center">剩余量：</td>
                     <td><asp:TextBox ID="txtBookRestNu" runat="server" Height="33px" Width="219px"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="auto-style6" style="text-align: center">上架日期：</td>
                     <td><asp:TextBox ID="txtBookTime" runat="server" Height="32px" Width="219px"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="auto-style6" style="text-align: center">&nbsp;</td>
                     <td>&nbsp;</td>
                 </tr>
             </table>
             &nbsp;
         <asp:SqlDataSource ID="sdsAddBook" runat="server" ConnectionString="<%$ ConnectionStrings:BookShopConnectionString %>" DeleteCommand="DELETE FROM [BookInfo] WHERE [Book_Id] = @original_Book_Id" InsertCommand="INSERT INTO [BookInfo] ([Book_Id], [Book_Name], [Book_Class_Id], [Book_Author], [Book_Press], [Book_Price], [Book_Number], [Book_RestNumber], [Book_Date]) VALUES (@Book_Id, @Book_Name, @Book_Class_Id, @Book_Author, @Book_Press, @Book_Price, @Book_Number, @Book_RestNumber, @Book_Date)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [BookInfo]" UpdateCommand="UPDATE [BookInfo] SET [Book_Name] = @Book_Name, [Book_Class_Id] = @Book_Class_Id, [Book_Author] = @Book_Author, [Book_Press] = @Book_Press, [Book_Price] = @Book_Price, [Book_Number] = @Book_Number, [Book_RestNumber] = @Book_RestNumber, [Book_Date] = @Book_Date WHERE [Book_Id] = @original_Book_Id">
             <DeleteParameters>
                 <asp:Parameter Name="original_Book_Id" Type="Int32" />
             </DeleteParameters>
             <InsertParameters>
                 <asp:ControlParameter ControlID="txtBookId" Name="Book_Id" PropertyName="Text" Type="Int32" />
                 <asp:ControlParameter ControlID="txtBookName" Name="Book_Name" PropertyName="Text" Type="String" />
                 <asp:ControlParameter ControlID="txtBookClassNu" Name="Book_Class_Id" PropertyName="Text" Type="Int32" />
                 <asp:ControlParameter ControlID="txtBookAuthor" Name="Book_Author" PropertyName="Text" Type="String" />
                 <asp:ControlParameter ControlID="txtBookPress" Name="Book_Press" PropertyName="Text" Type="String" />
                 <asp:ControlParameter ControlID="txtBookPrice" Name="Book_Price" PropertyName="Text" Type="Double" />
                 <asp:ControlParameter ControlID="txtBookNu" Name="Book_Number" PropertyName="Text" Type="Int32" />
                 <asp:ControlParameter ControlID="txtBookRestNu" Name="Book_RestNumber" PropertyName="Text" Type="Int32" />
                 <asp:ControlParameter ControlID="txtBookTime" Name="Book_Date" PropertyName="Text" Type="DateTime" />
             </InsertParameters>
             <UpdateParameters>
                 <asp:Parameter Name="Book_Name" Type="String" />
                 <asp:Parameter Name="Book_Class_Id" Type="Int32" />
                 <asp:Parameter Name="Book_Author" Type="String" />
                 <asp:Parameter Name="Book_Press" Type="String" />
                 <asp:Parameter Name="Book_Price" Type="Double" />
                 <asp:Parameter Name="Book_Number" Type="Int32" />
                 <asp:Parameter Name="Book_RestNumber" Type="Int32" />
                 <asp:Parameter Name="Book_Date" Type="DateTime" />
                 <asp:Parameter Name="original_Book_Id" Type="Int32" />
             </UpdateParameters>
         </asp:SqlDataSource>
             <br />
        <br />
         <asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_Click" Text="添加" Font-Size="Medium" style="font-size: x-large" />
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         <asp:Button ID="btnCancel" runat="server" OnClick="btnCancel_Click" Text="返回" Font-Size="Medium" style="font-size: x-large" />
        <br />
        &nbsp;<br />
        &nbsp;<br />
         <asp:Label ID="lblMsg" runat="server" style="font-size: large"></asp:Label>
        <br />
             <br />
             <br />
         <br />
             </center>
         </div>
         &nbsp;&nbsp;&nbsp;
         <br />
        <br />
    </center>
    </div>
    </form>
</body>
</html>
